package org.example.design.template;

import org.example.design.template.group.DangDangNetMall;
import org.example.design.template.group.JDNetMall;
import org.example.design.template.group.TaoBaoNetMall;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Classname Test
 * @Description 模板方法测试
 * @Date 2020/11/12 10:12 上午
 * @Created by xiangjd
 * 测试链接
 * 京东；https://item.jd.com/100008348542.html
 * 淘宝；https://detail.tmall.com/item.htm
 * 当当；http://product.dangdang.com/1509704171.html
 */
public class Test {
    private Logger logger = LoggerFactory.getLogger(Test.class);

    @org.junit.Test
    public void test() {
        NetMall netMall = new JDNetMall("10001", "*******");
        String base64 = netMall.generateGoodsPoster("https://item.jd.com/100008348542.html");
        logger.info("测试结果:{}", base64);
    }

    @org.junit.Test
    public void test1() {
        NetMall netMall = new TaoBaoNetMall("10002", "********");
        String base64 = netMall.generateGoodsPoster("https://detail.tmall.com/item.htm");
        logger.info("测试结果:{}", base64);
    }

    @org.junit.Test
    public void test2() {
        NetMall netMall = new DangDangNetMall("10003", "*******");
        String base64 = netMall.generateGoodsPoster("http://product.dangdang.com/1509704171.html");
        logger.info("测试结果:{}", base64);
    }
}
